<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>

<%@page import="com.cs.common.utils.NumberUtil"%>
<html:form action="/saveAdjustValuesToVersionPlant">
	<table width="<bean:write name="totalSize"/>" align="center" border="0">
		<tr>
			<td style="width: 100%" align="center">
				<table width="100%" align="center" border="0" cellspacing="1" bgcolor="#CCCCC0">
					<logic:present name="PlantVersionGroupsView">
						<logic:iterate name="PlantVersionGroupsView" id="plants" indexId="externalCount">
							<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
								<td width="147">
									<table width="100%" align="center" border="0" cellspacing="0" bgcolor="#CCCCC0">
										<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
											<td rowspan="4" width="50%">
												<bean:write name="plants" property="plantCode"/>
											</td>
											<td height="20">
												<bean:message key="label.plants.add.column.storage.amount.short"/>
											</td>
										</tr>
										<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
											<td height="20">
												<bean:message key="label.plants.add.column.max.unload.short"/>
											</td>
										</tr>
										<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
											<td height="20">
												<bean:message key="label.plants.add.column.grind"/>
											</td>
										</tr>
										<tr class="<%=((externalCount.intValue()%2)==0?"columnadatoPar":"columnadatoNon")%>">
											<td height="20">
												<bean:message key="label.plants.add.column.grind.protection.days.short"/>
											</td>
										</tr>
									</table>
								</td>
								<logic:iterate name="plants" property="monthPeriodsVersion" id="months" indexId="internalCount">
									<td>
										<input value="<bean:write name="months" property="storageAmount"/>" type="text" id="storageAmounts" size="8" name="plantVersionGroupsView[<%=internalCount.intValue()+((((Integer)request.getAttribute("totalPeriods")).intValue()-1)*externalCount.intValue())%>].storageAmount" class="columnanumero" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,3,false);"/><br/>
										<input value="<bean:write name="months" property="unloadAmount"/>" type="text" id="unloadAmounts" readonly="readonly" size="8" name="plantVersionGroupsView[<%=internalCount.intValue()+((((Integer)request.getAttribute("totalPeriods")).intValue()-1)*externalCount.intValue())%>].unloadAmount" class="columnanumero" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,3,false);"/><br/>
										<input value="<bean:write name="months" property="grind"/>" type="text" id="grinds" size="8" name="plantVersionGroupsView[<%=internalCount.intValue()+((((Integer)request.getAttribute("totalPeriods")).intValue()-1)*externalCount.intValue())%>].grind" class="columnanumero" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,3,false);"/><br/>
										<input value="<bean:write name="months" property="grindProtectionDays"/>" type="text" id="grindProtectionDayss" size="8" name="plantVersionGroupsView[<%=internalCount.intValue()+((((Integer)request.getAttribute("totalPeriods")).intValue()-1)*externalCount.intValue())%>].grindProtectionDays" class="columnanumero" onfocus="this.select();" onkeydown="return (numeric(event, 1) && noPaste(event, this));" onkeyup="extractNumber(this,2,false);"/><br/>
									</td>
								</logic:iterate>
							</tr>
						</logic:iterate>
					</logic:present>
					<tr class="columnadatoPar">
						<td align="right">
							<bean:message key="label.plants.add.column.grind.total"/>
						</td>
						<logic:notEmpty name="periodosVersion">
							<logic:iterate name="periodosVersion" id="periodos" indexId="int_i">
								<td width="150" class="etiqueta_campo_center">
									<%= com.cs.common.utils.NumberUtil.convertQuantity( (Double)((java.util.HashMap)request.getAttribute("SUM_GRIND_LABEL") ).get(Integer.toString(((com.cpi.cornpp.version.view.MonthPeriodVersionView)periodos).getId()))) %>
								</td>
							</logic:iterate>
						</logic:notEmpty>
					</tr>
					<tr>
						<td align="left" colspan="<bean:write name="totalPeriods"/>" height="30" class="etiqueta_campo">
							&nbsp;&nbsp;&nbsp;&nbsp;<html:submit styleClass="boton"><bean:message key="label.common.save"/></html:submit>
							<html:button property="cancel" onclick="location.href = 'showVersionDetail.do'" styleClass="boton"><bean:message key="label.common.cancel"/></html:button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</html:form>